package db;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import junit.framework.TestCase;

public class TmppurDAOTest extends TestCase {
TmppurDAO tmppurDao;
	
	protected void setUp() throws Exception {
		ApplicationContext ctx = new FileSystemXmlApplicationContext(
				"D:/workspace/ERP/src/applicationContext.xml");
		tmppurDao = TmppurDAO.getFromApplicationContext(ctx);
	}
	
	public void testGetTmppur() {
		int pn = 0;
		int pageSize = 10;
		
		List where = new ArrayList();
		
		where.add(new Object[]{"eq", "state", 1});
		where.add(new Object[]{"like", "tmpCode", "l20110623114221"});
		
		Map map = tmppurDao.getTmppur(pn,pageSize,
				new String[][]{new String[]{"desc","date"}},
				where,
				new String[][]{new String[]{"","id"},new String[]{"","tmpCode"}}
				,new String[]{"purreq","project"});
		System.out.println(map.get("recordSize"));
	}

}
